<template>
	<view class="" style="background: linear-gradient(180deg,#fff3eb, #fffbf9 100%)00%);min-height: 100vh;">
		<view class="u-padding-40">
			<view style="font-size: 52rpx;font-weight: bold;">店主认证</view>
			<view class="u-margin-top-20">距离成为店主就差一步了，快来加入我们吧~</view>
		</view>

		<view style="width: 700rpx;margin: auto;background: #fff;padding: 20rpx;border-radius: 20rpx;">
			<u-form :model="form" ref="uForm">
				<u-form-item label="姓名" label-width='150'>
					<u-input v-model="form.realname" placeholder='请输入姓名' />
				</u-form-item>
				<u-form-item label="联系电话" label-width='150'>
					<u-input v-model="form.phone" placeholder='请输入联系电话' />
				</u-form-item>
				<u-form-item label="开店预算" label-width='150'>
					<u-input v-model="form.budget" placeholder='请输入开店预算' />
				</u-form-item>
				<u-form-item label="开店城市" label-width='150'>
					<u-input v-model="form.address" type="select" @click='openCity' placeholder='请输入开店城市' />
				</u-form-item>
				<u-form-item label-position='top' label="咨询备注" label-width='150'>
					<u-input v-model="form.remark" type="textarea" placeholder='请输入您的备注' />
				</u-form-item>
			</u-form>
		</view>



		<view @click="tijiao"
			style="
		background: linear-gradient(180deg,#4f8bff , #745eff );
		border-radius: 58px;
		width: 700rpx;
		margin: auto;
		box-shadow: 0px 6px 12px 0px rgba(2,88,255,0.28);padding: 30rpx;margin-top: 20rpx;text-align: center;color: #fff;margin-top: 40rpx;">
			提交认证
		</view>


		<u-picker mode="region" v-model="cityShow" @confirm='confirmCity'></u-picker>
<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cityShow: false,
				form: {
					realname: "",
					phone: "",
					budget: "",
					address: "",
					remark: "",
				},

			};
		},
		methods: {
			tijiao() {

			},
			confirmCity(e) {
				let province = e.province.label;
				let city = e.city.label;
				let area = e.area.label;
this.form.address=province+city+area
			},
			openCity() {
				this.cityShow = true
			},
			tijiao() {
				this.$u.post('/index/apply', this.form).then(res => {
				  this.$refs.uToast.show({
				  	title: '请耐心等待认证结果',
				  	type: 'success',
				  	callback: () => {
				  		uni.navigateBack()
				  	}
				  
				  })
				})
			}
		},
		// 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
		onReady() {
			this.$refs.uForm.setRules(this.rules);
		}
	};
</script>

<style>
</style>
